package com.design.designmode.action.interceptor;

import java.util.HashSet;
import java.util.Set;

/**
 * @author hxl
 * @since 2023-04-18
 */
public class TerminalExpression implements Expression {
    private Set<String> set = new HashSet<>();

    public TerminalExpression(String[] data) {
        // for (遍历对象类型 对象名 : 遍历对象)
        for (String str : data) {
            set.add(str);
        }
    }


    @Override
    public boolean Interpret(String info) {
        return set.contains(info);
    }
}
